<template>
  <div class="wrapper">
    <div class="questions">
      <Questions></Questions>
    </div>
    <div class="right">
      <Options></Options>
      <Timer></Timer>
    </div>
  </div>
</template>

<script>
import Questions from "../../components/questions";
import Options from "../../components/options";
import Timer from "../../components/timer";
import {mapState,mapMutations} from 'vuex'
export default {
  layout: "main",
  beforeDestroy(){
    this.INIT()
  },
  components: {
    Questions,
    Options,
    Timer,
  },
  methods: {
    ...mapMutations('test',['INIT']),
    timeOver(time, score) {
      this.$alert(
        `<strong>${
          score >= 60
            ? "牛逼呀~未来的业界大佬一定有你一席之地~"
            : "啥也不是，赶紧交了再去学学吧！"
        }</strong><div>用时：${time}</div><div>分数：${score}</div>`,
        {
          confirmButtonText: "确定",
          dangerouslyUseHTMLString: true,
        }
      );
    },
  },
  computed:{
    ...mapState('test',["checkedList"])
  }
};
</script>

<style scoped>
.wrapper {
  display: flex;
}

.questions {
  flex: 1;
}

.right {
  width: 270px;
}
</style>